clear
clc
A = imread('lena.tif');
figure,imshow(A);
h = (1/25)*ones(5);
H = ifftshift(freqz2(h,512,512));
%figure,surf(H);

F = fft2(double(A),512,512);
% G = imfilter(double(A),h,'conv');
% g = mat2gray(G);
% figure,imshow(g);
% B = mat2gray(double(A))-g;
% figure,imshow(mat2gray(B));

G1 = H.*F;
G2 = abs(ifft2(G1,512,512));
%figure,imshow(mat2gray(G2));

%G3 = mat2gray(double(A))-mat2gray(G2);
figure,imshow(mat2gray(G2));

B = double(A);
for i = 0 : 0.2 : 1.0
    T = dFRT(512,i);
    B1 = T*B*T;
    G = H.*B1;
    T = dFRT(512,-i);
    B = abs(T*G*T);
end

figure,imshow(mat2gray(B));







